package org.infoset.xml;

import java.util.*;
import java.io.*;
import java.net.*;

/**
 * This interface represents a infoset item in an XML document.  
 * @author <a href="mailto:alex@milowski.com">R. Alexander Milowski</a>
 */

public interface Item {

   enum ItemType {
      AnyItem,
      DocumentItem,
      ElementItem,
      AttributeItem,
      CharactersItem,
      CommentItem,
      ProcessingInstructionItem,
      ElementEndItem,
      DocumentEndItem,
      NamespaceItem,
      SequenceItem,
      SequenceEndItem,
      ValueItem
   }
   
   /**
    * Returns a globally unique identifier for this node.
    */
   String getGeneratedId();

   /**
    * Returns the type of type node.
    */
   ItemType getType();


   /**
    * Returns the origin of this node.  This is either the element on which
    * the attribute is declared or the parent of the node.
    */
   Parent getOrigin();

   /**
    * This method returns the same as getOrigin().getDocument().  That is, the
    * document that contains this item.
    */
   Document getDocument();

   /**
    * Compares this node to another node returning 1, 0, or -1.
    * @param other The node with which to compare.
    */
   int compareTo(Item other);

   /**
    * Returns the document context.
    */
   Infoset getInfoset();
   
   /**
    * Copies the item--producing a duplicate of the item
    * @param copyAll Copies all attributes and descedants of the node
    */
   Item copyOfItem(boolean copyAll);
   
}




